package com.group3.pojo.receive;

import com.group3.controller.Validated.Add;
import com.group3.controller.Validated.Update;
import com.group3.domain.Lesson;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Set;

/**
 * AddLessonReceive
 *
 * @author HY
 * 2021/07/06 14:27
 **/

@Data
public class AddLessonReceive {

    @Min(value = 0, message = "课程id不能为空", groups = {Update.class})
    @ApiModelProperty(value = "课程id", required = true)
    private Integer lessonId;

    @NotEmpty(message = "课程名不能为空", groups = {Add.class})
    @ApiModelProperty(value = "课程名", required = true)
    private String lessonName;

    @Min(value = 0, message = "责任老师不能为空", groups = {Add.class})
    @ApiModelProperty(value = "责任老师id", required = true)
    private Integer teacherZId;

    @NotNull(message = "实训老师不能为空", groups = {Add.class})
    @ApiModelProperty(value = "实训老师id", required = true)
    private Set<Integer> teacherSIds;

    public Lesson getLesson(){
        Lesson lesson = new Lesson();

        lesson.setLessonId(this.lessonId);
        lesson.setLessonName(this.lessonName);
        lesson.setLessonId(this.teacherZId);

        return lesson;
    }
}
